<?
if(!defined ('U_MOD'))
{
	echo"<meta http-equiv='refresh' content='0;url=/index.php'>";
	exit;
}

$refferUrl=getRefferUrl($_SERVER['HTTP_REFERER'], $portal_url);

if (isset($act) && is_numeric($act))
{
	if ($act==1 && isset($tid))
	{
		$querySelectTitle=mysql_query("SELECT titles_keywords, titles_key_generate FROM ".$PortalPref.$amk." WHERE titles_id='".$tid."'");
		if (mysql_num_rows($querySelectTitle)==1)
		{
			$resultSelectTitle=mysql_fetch_assoc($querySelectTitle);
			extract($resultSelectTitle);

			if(mysql_query("DELETE FROM ".$PortalPref.$amk." WHERE titles_id='".$tid."'"))
			{
				if ($titles_key_generate==0)
				{
					$avialable_langs = explode(",", $option['avialable_langs']);

					for($lid=0; $lid<count($avialable_langs); $lid++)
					{
						mysql_query("DELETE FROM ".$PortalPref."langs_".$avialable_langs[$lid]." WHERE lang_param='".$titles_keywords."'");
					}
				}
				print '<p align="center">'._OPERATION_SUCCESS_.'</p>';
			}else
				print '<p align="center">'.BAD_SQL_.'</p>';
		}else
			print '<p align="center">'.BAD_SQL_.'</p>';
	}
}

echo"<meta http-equiv='refresh' content='0;url=".$refferUrl."'>";
?>